<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--<link rel="stylesheet" href="__ROOT__/Public/layui/css/layui.css">-->
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css">
    <link rel="stylesheet" href="__PUBLIC__/css/main.css">
    <style>
        .content {
            width: 500px;
            height: 500px;
            color: black;
            background-color: white;
            position: absolute;
            top: 50%;
            left: 50%;
            margin-top: -250px;
            margin-left: -250px;
        }

        h1 {
            text-align: center;
            margin: 50px auto;
        }

        .btn-left {
            margin-left: 110px;
        }

        #refimg {
            margin-left: 100px;
        }
    </style>
</head>
<body class="layui-bg-green">
<div class="content">
    <form class="layui-form" method="post" action="doreg">
        <h1 style="text-align: center">注册</h1>
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <input class="layui-input layui-input-inline" type="text" name="Aname" placeholder="请输入新的用户名">
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码</label>
            <input class="layui-input layui-input-inline" type="password" name="Apassword" placeholder="请输入密码">
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">验证码</label>
            <input class="layui-input layui-input-inline" type="text" name="check" placeholder="请输入验证码">
            <img id="refimg" src="{:U('register/getVerify')}" alt="验证码">
        </div>

        <div class="btn-left">
            <a href="{:U('login/index')}" class="layui-btn layui-btn-lg layui-btn-primary" type="submit">返回</a>
            <input class="layui-btn layui-btn-lg" type="submit" value="注册">
        </div>
    </form>
</div>
<script src="__PUBLIC__/layui/layui.js"></script>
<script>
    layui.use('form', function () {
        var form = layui.form;
        //自定义验证规则
    });
    document.getElementById('refimg').onclick = ref;

    function ref() {
        var refimg = document.getElementById('refimg');
        refimg.src = "{:U('register/getVerify')}";
    }
</script>
</body>
</html>